package thread.singleton;

class SingletonLazy{
    private static SingletonLazy instance = null;

    private SingletonLazy(){

    }

    public static SingletonLazy getInstance(){
        if(instance == null){
            instance = new SingletonLazy();
        }
        return instance;
    }
}

public class Demo2 {
    public static void main(String[] args) {
        SingletonLazy instance = SingletonLazy.getInstance();
        SingletonLazy instance1 = SingletonLazy.getInstance();
        System.out.println(instance == instance1);
    }
}
